package app.server.project.main.service.service.auth.tg;

import java.util.Map;

/**
 * 验证结果类
 */
public class VerificationResult {
    private final boolean success;
    private final String errorMessage;
    private final Map<String, String> data;

    private VerificationResult(boolean success, String errorMessage, Map<String, String> data) {
        this.success = success;
        this.errorMessage = errorMessage;
        this.data = data;
    }

    public static VerificationResult success(Map<String, String> data) {
        return new VerificationResult(true, null, data);
    }

    public static VerificationResult failure(String errorMessage) {
        return new VerificationResult(false, errorMessage, null);
    }

    public boolean isSuccess() {
        return success;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public Map<String, String> getData() {
        return data;
    }

    @Override
    public String toString() {
        return success
                ? "Verification successful"
                : "Verification failed: " + errorMessage;
    }
}
